﻿CREATE TABLE [dbo].[vk_Relations] (
    [Id]           BIGINT         IDENTITY (1, 1) NOT NULL,
    [UserId]       NVARCHAR (128) NOT NULL,
    [PartnerId]    NVARCHAR (128) NOT NULL,
    [Complete]     BIT            CONSTRAINT [DF_vk_Relations_Complete] DEFAULT ((0)) NOT NULL,
    [Approve]      BIT            CONSTRAINT [DF_vk_Relations_Approve] DEFAULT ((0)) NOT NULL,
    [CreateDate]   DATETIME       CONSTRAINT [DF_vk_Relations_CreateDate] DEFAULT (getutcdate()) NOT NULL,
    [CompleteDate] DATETIME       NULL,
    CONSTRAINT [PK_vk_Relations] PRIMARY KEY CLUSTERED ([Id] ASC)
);




GO
CREATE NONCLUSTERED INDEX [IX_vk_Relations_UserId]
    ON [dbo].[vk_Relations]([UserId] ASC);


GO
CREATE NONCLUSTERED INDEX [IX_vk_Relations_PartnerId]
    ON [dbo].[vk_Relations]([PartnerId] ASC);


GO
CREATE NONCLUSTERED INDEX [IX_vk_Relations_Complete]
    ON [dbo].[vk_Relations]([Complete] ASC);

